package com.joysuch.wwyt.bp.repository;

import com.joysuch.wwyt.bp.entity.investigate.BpInvestigateStore;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author ZhangDong
 * @Date 2020/3/25 10:50
 */
public interface BpInvestigateStoreRepository extends JpaRepository<BpInvestigateStore, Long> {

    List<BpInvestigateStore> findByParentId(Long parentId);

    BpInvestigateStore findFirstByCheckTypeNameAndParentId(String checkTypeName, Long parentId);
    
    @Query(value = "SELECT check_type_name from wwyt_bp_investigate_store where id = ?1",nativeQuery = true)
    String getNameById(Long storeId);
}
